summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/test/fixtures/render-html/src/pages/[slug].astro
blob: 1f60f6589b29a2098a3df33654d7a2ea1aadd2f7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
---
import { getEntryBySlug, getCollection } from "astro:content";

const { slug } = Astro.params;

const post = await getEntryBySlug('blog', slug);
const { Content } = await post.render();

export async function getStaticPaths() {
  const blogEntries = await getCollection('blog');
  return blogEntries.map(entry => ({
    params: { slug: entry.slug }, props: { entry },
  }));
}

---

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Content</title>
</head>
<body>
	<Content />	
</body>
</html>